package com.powernode.config;

import com.powernode.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 内容:
 * 作者:cy
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/login/toLogin.do")
                .excludePathPatterns("/index.html")
                .excludePathPatterns("/login/doLogin.do")
                .excludePathPatterns("/captcha.do")
                .excludePathPatterns("/resources/**")
                .excludePathPatterns("/error/**");
    }
}
